package com.airticketbooking.controller.user;

import com.airticketbooking.common.domain.Result;
import com.airticketbooking.service.PaymentService;
import com.airticketbooking.service.UserService;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;



@RequestMapping("air/user/Payment")
@RestController
@Api(tags = "用户端支付相关接口")
@RequiredArgsConstructor
@Slf4j

public class PaymentController {

	private final PaymentService paymentService;

	private final UserService userService;


//	根据订单号创建支付实体

	@GetMapping("/createPayment")
	public Result<String> createPaymentByOrderId(@RequestParam Integer orderId) {

		try {
			paymentService.createPaymentByOrderId(orderId);
			return Result.ok("支付实体创建成功");

		} catch (Exception e) {
			return Result.error(e.getMessage());
		}

	}


}
